import httpUtil from '../utils/request'

export function templatePage(ns,ds,author,page,limit){
    const params = {
        ns,
        ds,
        author,
        page,
        limit
    }
    return httpUtil({
        url: '/code/template/page',
        method: 'get',
        params: params
    })
}

export function  templateList(ns,ds){
    const params = {
        ns,
        ds
    }
    return httpUtil({
        url: '/code/template/list',
        method: 'get',
        params: params
    })
}


export function templateInfo(id){
    return httpUtil({
        url: '/code/template/info/' + id,
        method: 'get'
    })
}


export function templateDel(ns,ds,ids){
    const data = {
        ns,
        ds,
        ids
    }
    return httpUtil({
        url: '/code/template/del',
        method: 'post',
        data: data
    })
}

export function templateAdd(data){
    return httpUtil({
        url: '/code/template/add',
        method: 'post',
        data: data
    })
}

export function templateUpdate(data){
    return httpUtil({
        url: '/code/template/update',
        method: 'post',
        data: data
    })
}

